function res = thinPlateFunc(X, sigma)

if nargin < 2
    X_sigma = X;
else
    X_sigma = X / sigma;
end

% res = 2*(X_sigma.^2).*log(X_sigma+realmin);
res = (X_sigma.^2).*log(X_sigma+realmin);
